
import { Action } from '@ngrx/store';

import { TreeItem } from '../../components';

export enum PublicActionTypes {
    LOAD_PUBLIC = '[Public] Load Public',
    LOAD_PUBLIC_FAIL = '[Public] Load Public Fail',
    LOAD_PUBLIC_SUCCESS = '[Public] Load Public Success'
}

export class LoadPublic implements Action {
    readonly type = PublicActionTypes.LOAD_PUBLIC;
}

export class LoadPublicFail implements Action {
    readonly type = PublicActionTypes.LOAD_PUBLIC_FAIL;
    constructor(public payload: any) {}
}

export class LoadPublicSuccess implements Action {
    readonly type = PublicActionTypes.LOAD_PUBLIC_SUCCESS;
    constructor(public payload: TreeItem[]) {}
}

export type PublicAction
    = LoadPublic
    | LoadPublicFail
    | LoadPublicSuccess;